package edu.scau.comeva.rigcontrol.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: Dan
 * Date: 13-8-18
 * Time: 上午1:01
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table
public class m_student implements Serializable {
    private long student_id;
    private String student_username;
    private String student_password;
    private m_class student_class;
    private m_studentDetal student_detal;
    private int student_rolekind;//默认为1

    @Id
    @GeneratedValue
    public long getStudent_id() {
        return student_id;
    }

    public void setStudent_id(long student_id) {
        this.student_id = student_id;
    }

    public String getStudent_username() {
        return student_username;
    }

    public void setStudent_username(String student_username) {
        this.student_username = student_username;
    }

    public String getStudent_password() {
        return student_password;
    }

    public void setStudent_password(String student_password) {
        this.student_password = student_password;
    }

    @ManyToOne
    @JoinTable(
            name = "m_student_class",
            joinColumns = @JoinColumn(name = "fk_student_id",referencedColumnName = "student_id"),
            inverseJoinColumns = @JoinColumn(name = "fk_class_id",referencedColumnName = "class_id")
    )
    public m_class getStudent_class() {
        return student_class;
    }

    public void setStudent_class(m_class student_class) {
        this.student_class = student_class;
    }

    @OneToOne(mappedBy = "studentdetal_student")
    public m_studentDetal getStudent_detal() {
        return student_detal;
    }

    public void setStudent_detal(m_studentDetal student_detal) {
        this.student_detal = student_detal;
    }

    public int getStudent_rolekind() {
        return student_rolekind;
    }

    public void setStudent_rolekind(int student_rolekind) {
        this.student_rolekind = student_rolekind;
    }
}
